package com.onlinevideo.servlet;

import com.onlinevideo.entity.Video;
import com.onlinevideo.service.impl.VideoServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class bg_Servlet extends BaseServlet{
    VideoServiceImpl videoService = new VideoServiceImpl();
    protected void checkVideo(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String videoIdStr = req.getParameter("videoId");
        String passStr = req.getParameter("pass");
        Long vid = Long.valueOf(videoIdStr);
        Integer pass = Integer.valueOf(passStr);
        Video video = videoService.queryById(vid);
        video.setVideoStatus(pass);
    }

    protected void showVideos(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {



        resp.sendRedirect("../gateway?action=.jsp");
    }
}
